﻿function register() {
    jzcode.event.registerEvent('popup-close', function () {
        GotoMainMode();
    });
    jzcode.event.registerEvent('chart-wtsld', function () {
        GotoSubMode();
        showChartWTSLD();
    });
    jzcode.event.registerEvent('chart-tg', function () {
        GotoSubMode();
        showChartTG();
    });
    jzcode.event.registerEvent('chart-zc', function () {
        GotoSubMode();
        showChartZC();
    });
    jzcode.event.registerEvent('chart-dg', function () {
        GotoSubMode();
        showChartDG();
    });
    jzcode.event.registerEvent('select-wtsld', function () {
        jzcode.com.foreach(g_nodeArr, function (item, args) {
            if (item.event != 'select-wtsld')
                item.isSelected = false;
            else
                item.isSelected = true;
        });
    });
    jzcode.event.registerEvent('select-tg', function () {
        jzcode.com.foreach(g_nodeArr, function (item, args) {
            if (item.event != 'select-tg')
                item.isSelected = false;
            else
                item.isSelected = true;
        });
    });
    jzcode.event.registerEvent('select-zc', function () {
        jzcode.com.foreach(g_nodeArr, function (item, args) {
            if (item.event != 'select-zc')
                item.isSelected = false;
            else
                item.isSelected = true;
        });
    });
    jzcode.event.registerEvent('select-dg', function () {
        jzcode.com.foreach(g_nodeArr, function (item, args) {
            if (item.event != 'select-dg')
                item.isSelected = false;
            else
                item.isSelected = true;
        });
    });
};